var express = require('express');
var router = express.Router();
var query = require('./Database');
/* GET home page. */
router.get('/', function(req, res, next) {
    res.render('ProAccount', {});
});
router.post('/account',async (req,res)=>{
    // console.log(req.body);
    let list = req.body;
    console.log('--------------');
    console.log(list);
    let rows = await query("select * from account where userid = "+ list.userid +" order by id desc limit 1");
    let scorows = await query("select nowsco from score where userid = " +list.userid +" order by id desc limit 1");
    // let goodsrows = await  query("select DISTINCT shopid,state,goodstime from goods");
    console.log('+++++++++++++++++++');
    console.log(rows);
    console.log(rows,scorows);
    console.log('+++++++++++++++++++');
    let data = [{code:100},rows,scorows];
    res.send(data);
});
module.exports = router;